<!-- 机器人列表 -->
<template>
    <div class="page-box h100 display-flex czbj">
        <div>
            <dxtable :headBtn="headBtn" :formJson="formJson" :dataJson="dataJson" :portUrl="portUrl" :qx="qx" ref="databale"></dxtable>
        </div>
    </div>
</template>
<script lang='ts' setup>
import { rowDark } from "naive-ui/es/legacy-grid/styles";
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost, qurl, hf } from "../../util/index";
import { h, ref, reactive } from "vue";
const props = defineProps({
    pup: { type: String },
});

let headBtn = [];
const zdList = ref()
const databale = ref();
const initeer = () => {
    databale.value.initDataExpose();
};
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = reactive([
    {
        title: "助理头像",
        key: "headPortrait",
        width: 100,
        render(row){
            return h("img",{src:row.headPortrait,class:"usjjkertwre"})
        }
    },
    {
        title: "助理名称",
        key: "name",
        search: true, // 是否在搜索栏展示
        width:200
    },
    {
        title: "按钮名称",
        key: "buttonName",
        search: true, // 是否在搜索栏展示
        width:120
    },
    {
        title: "简介",
        key: "synopsis",
    },
    {
        title: "排序",
        width: 100,
        render(row) {
            row.databaseName = "gptRobotList";
            return h(sort, {
                row,
                onCallBack: () => {
                    initeer();
                },
            });
        },
    },
    {
        title: "添加时间",
        key: "addTime",
        width: "140",
        type: "daterange",
    },
]);
let portUrl = "chatgpt/gptRobotList";
const qx = {
    DeletePermissionID: "chatGPTRobotListdel", //删除
    EditPermissionIdentifier: "chatGPTRobotListbj", // 编辑
    NewPermissionIdentifier: "chatGPTRobotListxz", // 新建
    ViewPermissionID: "chatGPTRobotListck", // 查看
};


let formJson = reactive([

    {
        title: "助理头像",
        key: "headPortrait",
        type:"img",
        required: true, 
    },
    {
        title: "助理名称",
        key: "name",
        type:"input",
        required: true, 
    },
    {
        title: "按钮名称",
        key: "buttonName",
        type:"input",
       
        required: true, 
    },
    {
        title: "简介",
        key: "synopsis",
        type:"textarea",
        required: true, 
    },
{
        title: "知识库",
        key: "SYSTEM",
        type:"textarea",
        required: true, 
    },
    
])



</script>
  
  
  